#!/bin/tcsh


### Elapsed time example  
###===================
@ before = `date +%s`
@ after = `date +%s`
@ elapsed_seconds = `expr $after - $before`
@ hh = `expr $elapsed_seconds / 3600`
@ mm = `expr $elapsed_seconds / 60 % 60`
@ ss = `expr $elapsed_seconds % 60`

echo Elapsed time: {$hh}:{$mm}:{$ss} "("$elapsed_seconds "seconds"")"
#cho Elapsed time:$elapsed_seconds seconds
###===================


### while loop, example
###====================
if (! -d TEST) then
mkdir TEST
endif

rm -rf TEST/*

@ n = 4
 while ($n <= 10)
echo now it is {$n}.
if ($n < 10) then
mkdir TEST/set0$n
else
mkdir TEST/set$n
endif

 @ n = ($n + 1)
end
###====================


